import { createRouter, createWebHashHistory } from 'vue-router'



const constantRoutes = [{
  path: '/',
  name: 'Index',
  redirect: '/index',
  component: () => import('../layout/layout.vue'),
  meta: {
    title: '首页',
    icon: 'none'
  },
  children: [
    {
      path: '/index',
      name: 'indexPage',
      meta: {
        title: '首页'
      },
      component: () => import('../pages/Index.vue')
    },
    {
      path: '/css3',
      name: 'Css3Practice',
      meta: {
        title: 'css3'
      },
      component: () => import('../components/css3practice.vue')
    },
    {
      path: '/form',
      name: 'form',
      meta: {
        title: '表单'
      },
      component: () => import('../pages/FormPage.vue')
    }
  ]
}]

const router = createRouter({
  history: createWebHashHistory(),
  scrollBehavior: () => ({ y: 0 }),
  routes: [...constantRoutes]
})

export default router